package main.UI.misc;

import javax.swing.*;

/**
 * Created by Sknictik on 27.12.13.
 * Class for errors, warnings and exceptions handling
 */
public class ErrorHandling {
    public static void showError(Exception e, String errMsg, boolean critical) {
        if (e != null)
            e.printStackTrace();
        JOptionPane.showMessageDialog(null, errMsg, "Ошибка", JOptionPane.ERROR_MESSAGE);
        if (critical)
            System.exit(-1);
    }

    public static void showWarning(String wrgMessage) {
        JOptionPane.showMessageDialog(null, wrgMessage);
    }
}
